package com.huilian.iotbox.mqtt.server.base.dao;

import com.huilian.iotbox.data.dto.MemberStoreBalanceDto;
import com.huilian.iotbox.data.po.MemberStoreBalance;
import com.huilian.iotbox.data.vo.MemberStoreBalanceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface MemberStoreBalanceDao {

    MemberStoreBalanceVo findMemberStoreBalanceByMerchantStoreId(MemberStoreBalanceDto memberStoreBalanceDto);

    void insert(MemberStoreBalance memberStoreBalance);

    MemberStoreBalance findOneMemberStoreBalanceById(long memberStoreBalanceId);

    int addMemberStoreBalance(@Param("rechargeNum") int rechargeNum, @Param("donateNum") int donateNum, @Param("memberStoreBalanceId") long memberStoreBalanceId, @Param("memberId") long memberId, @Param("userId") int userId, @Param("merchantStoreId") int merchantStoreId, @Param("versionId") Integer versionId);

    int reduceMemberStoreBalance(int rechargeNum, int donateNum, Long memberStoreBalanceId, Long memberId, Integer userId, Integer merchantStoreId, Integer versionId);

    int addMemberStoreChargeBalance(MemberStoreBalance memberStoreBalance);
}
